const render = () => {
  let $app = document.getElementById('app');
  let hash = location.hash.replace('#', '');
  if (hash === 'test1') {
    import(/* webpackChunkName: 'component_test1' */ './test1.js').then(module => {
      $app.appendChild(module.default());
    });
  } else if (hash === 'test2') {
    import(/* webpackChunkName: 'component_test2' */ './test2.js').then(module => {
      $app.appendChild(module.default());
    });
  }
}

render();